#remove spaces and convert to line breaks
#file in, file out

inStream = open("file to reformat line breaks.txt")
txt = inStream.read()
inStream.close()
saveFile = open("breaks.txt",'w')

maxLen = len(txt)

for curLen in range(maxLen,1,-1):
    txt = txt.replace(curLen * ' ', '\n')

print txt
saveFile.write(txt)
saveFile.close()
